<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$meta_title}</title>
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="">
  <link rel="apple-touch-icon-precomposed" href="">
  <meta name="apple-mobile-web-app-title" content="{$meta_title}" />
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/admin.css">
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/mycss.css">
  <script src="__PUBLIC__/js/laydate/laydate.js"></script>
  <script type="text/javascript">var _config = <?php echo Auth::getConfig();?></script>
  <script type="text/javascript" src="__PUBLIC__/libs/dingding/javascripts/zepto.min.js"></script>
  <script type="text/javascript" src="http://g.alicdn.com/dingding/dingtalk-pc-api/2.6.2/index.js"></script>
  <script type="text/javascript" src="__PUBLIC__/libs/dingding/javascripts/logger.js"></script>
   <style type="text/css">
		.am-form div.am-text-right{padding:7px 0;}
	</style>
</head>
<body>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <ul class="am-list admin-sidebar-list">
        <li ><a href="#"><span><img alt="{$user_info.name}" src="{$user_info.avatar}"  style="display: block; margin: 0 auto; width: 80%;border-radius: 50%;"></span> {$user_info.name}</a></li>
        <li ><a href="/Home/Task/shouye"><span class="am-icon-home"></span> 首页</a></li>
        <li class="nav-active"><a href="/Home/Service/index"><span class="am-icon-puzzle-piece"></span>服务</a></li>      
      </ul>
      
    </div>
  </div>
  <!-- sidebar end -->

<!-- content start -->
<div class="admin-content" style="overflow-y: scroll;">
  <div class="admin-content-body">
    <div class="am-cf am-my-title">{$meta_title}</div>
      
<form class="am-form" id="serviceform" action="/Home/Service/add" method="post">
             
              <div class="am-g am-margin-top" id="body">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">请选择服务主体</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="service_body" id="service_body" onchange="select_body();">
	              	<option value="0">请选择</option>
	              	<volist name="service_body" id="vo" key="k">
	              		<option value="{$vo.fieldvalue}">{$vo.title}</option>
	                </volist>
	              </select>
	            </div>
	          </div>  
             
 	          
	         	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">服务类型</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	            	<select name="service_type" >
	              		<volist name="service_type" id="vo" >
					            <option value="{$vo.fieldvalue}">{$vo.title}</option>
						</volist>
	               </select>
	            </div>
	          </div>  
	          
	                     
            
             <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                服务内容
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="service_content" placeholder="请填写服务内容"></textarea>
              </div>
            </div>
            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                服务结果
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="service_result" placeholder="请填写服务结果"></textarea>
              </div>
            </div>
            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                客户反馈
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="feedback" placeholder="请填写客户反馈"></textarea>
              </div>
            </div>

            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                备注
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="remark" placeholder="请填写备注"></textarea>
              </div>
            </div>

          </form>
   		<div class="am-g am-margin-top am-margin">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">&nbsp;&nbsp;</div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                 <button type="button" class="am-btn am-btn-primary am-btn-xs" id="saveservice">提交保存</button>
      			 <button type="button" class="am-btn am-btn-primary am-btn-xs" onClick="javascript :history.back(-1);">放弃保存</button>
    		  </div>
          </div> 
	

  </div>
</div>
<!-- content end -->

</div>

<script type="text/javascript" >

//选择服务主体
function select_body(){
	var val=$('#service_body option:selected') .val();
	$('#so').remove();$('#se').remove();
	if(val==0){
		
		DingTalkPC.device.notification.toast({
		    type: "error", //toast的类型 alert, success, error, warning, information, confirm
		    text: '请选择服务主体！', //提示信息
		    duration: 3, //显示持续时间，单位秒，最短2秒，最长5秒
		    delay: 0, //延迟显示，单位秒，默认0, 最大限制为10
		    onSuccess : function(result) {
		        /*{}*/
		    },
		    onFail : function(err) {}
		})
	}else if(val==1){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索项目</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_project" placeholder="请输入项目ID/名称/编号">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button"  onclick="searchPro();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">项目编号</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="projectid">	              	<volist name="project_number" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==2){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索客户</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_customer" placeholder="请输入客户名/编号/手机号">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchCus();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">客户</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="customerid">	              	<volist name="customer" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==3){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索网站</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_website" placeholder="请输入网站名称/域名">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchWeb();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">网站</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="websiteid">	              	<volist name="website" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==4){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索域名</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_domain" placeholder="请输入域名">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchDom();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">域名</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="domainid">	              	<volist name="domain" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==5){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索代理</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_reverse" placeholder="请输入网站名">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchRev();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">代理</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="reverseid">	              	<volist name="reverse" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==6){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索服务器</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_server" placeholder="请输入服务器名称/IP">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchSer();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">服务器</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="serverid">	              	<volist name="server" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==7){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索数据库</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_database" placeholder="请输入数据库名称/账号">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchDat();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">数据库</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="databaseid">	              	<volist name="database" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}else if(val==8){
		var html='<div class="am-g am-margin-top" id="so"> <div class="am-u-sm-4 am-u-md-2 am-text-right">搜索主机</div>            <div class="am-u-sm-12 am-u-md-4 am-u-end" >	          <div class="am-input-group am-input-group-sm">	            <input type="text" class="am-form-field" id="so_master" placeholder="请输入主机名称/域名">	          <span class="am-input-group-btn">	            <button class="am-btn am-btn-default" type="button" onclick="searchMas();">搜索</button>	          </span>	          </div>	        	</div>            </div>   <div class="am-g am-margin-top" id="se">	            <div class="am-u-sm-4 am-u-md-2 am-text-right">主机</div>	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">	              <select name="service_bodyid" id="masterid">	              	<volist name="master" id="vo" key="k" class="volist">	                <option value="{$vo.id}">{$vo.title}</option>	                </volist>	              </select>	            </div>	          </div>';
		
	}
	$('#body').after(html);
	
};

//搜索项目
function searchPro(){
	var keyword=$('#so_project').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Task/getProjectAjax')}";
	$.post(url,params,function(data) {
		
			$('#projectid').html(data);
		
	});
};

//搜索客户
function searchCus(){
	var keyword=$('#so_customer').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getCustomerAjax')}";
	$.post(url,params,function(data) {
		
			$('#customerid').html(data);
		
	});
};
//搜索网站
function searchWeb(){
	var keyword=$('#so_website').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getWebsiteAjax')}";
	$.post(url,params,function(data) {
		
			$('#websiteid').html(data);
		
	});
};
//搜索domain
function searchDom(){
	var keyword=$('#so_domain').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getDomainAjax')}";
	$.post(url,params,function(data) {
		
			$('#domainid').html(data);
		
	});
};
//搜索reverse
function searchRev(){
	var keyword=$('#so_reverse').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getReverseAjax')}";
	$.post(url,params,function(data) {
		
			$('#reverseid').html(data);
		
	});
};
//搜索server
function searchSer(){
	var keyword=$('#so_server').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getServerAjax')}";
	$.post(url,params,function(data) {
		
			$('#serverid').html(data);
		
	});
};
//搜索database
function searchDat(){
	var keyword=$('#so_database').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getDatabaseAjax')}";
	$.post(url,params,function(data) {
		
			$('#databaseid').html(data);
		
	});
};
//搜索master
function searchMas(){
	var keyword=$('#so_master').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getMasterAjax')}";
	$.post(url,params,function(data) {
		
			$('#masterid').html(data);
		
	});
};
 

//提交表单
	$('#saveservice').click(function(){
	 	$('#serviceform').submit();
	});
</script>

<script src="__ROOT__/Application/Home/View/default/assets/js/jquery.min.js"></script>

<script src="__ROOT__/Application/Home/View/default/assets/js/amazeui.min.js"></script>
<script src="__ROOT__/Application/Home/View/default/assets/js/app.js"></script>
</body>
</html>
